﻿using project.B12.Model.Res;
using software.Common.MVVM;
using software.dll.user;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace project.B12.Model.Models
{
    public class RoleRightModel : ObservableObject
    {
        public RoleRightModel(bool flag, RightModel right)
        {
            Flag = flag;
            Right = right;
        }

        private bool flag;

        /// <summary>
        /// 是否有此权限
        /// </summary>
        public bool Flag
        {
            get { return flag; }
            set { flag = value; RaisePropertyChanged(); }
        }

        public RightModel Right { get; set; }
    }

    public enum RoleEnum
    {
        [Display(ResourceType = typeof(Resources), Name = "RoleEnum_Debug")]
        [Description("厂家账号")]
        厂家账号,

        [Display(ResourceType = typeof(Resources), Name = "RoleEnum_Admin")]
        [Description("超级管理员")]
        超级管理员,

        [Display(ResourceType = typeof(Resources), Name = "RoleEnum_Manage")]
        [Description("管理员")]
        管理员,

        [Display(ResourceType = typeof(Resources), Name = "RoleEnum_User")]
        [Description("普通用户")]
        普通用户,
    }

    public enum RightEnum
    {
        [Display(ResourceType = typeof(Resources), Name = "UserManagerUsability")]
        [Description("用户权限(可用性)")]
        UserManagerUsability = 1,

        [Display(ResourceType = typeof(Resources), Name = "UserManagerResetPassword")]
        [Description("用户权限(重置密码)")]
        UserManagerResetPassword = 2,

        [Display(ResourceType = typeof(Resources), Name = "UserManagerExpirationTime")]
        [Description("用户权限(过期时间)")]
        UserManagerExpirationTime = 3,

        [Display(ResourceType = typeof(Resources), Name = "UserManagerDelete")]
        [Description("用户权限(删除)")]
        UserManagerDelete = 4,

        [Display(ResourceType = typeof(Resources), Name = "UserManagerAdd")]
        [Description("用户权限(新建)")]
        UserManagerAdd = 5,

        [Display(ResourceType = typeof(Resources), Name = "ReadingManager")]
        [Description("读数权限")]
        ReadingManager = 6,

        [Display(ResourceType = typeof(Resources), Name = "CurveManager")]
        [Description("曲线权限")]
        CurveManager = 7,

        [Display(ResourceType = typeof(Resources), Name = "AnalysisManager")]
        [Description("分析权限")]
        AnalysisManager = 8,

        [Display(ResourceType = typeof(Resources), Name = "ProtocolManager")]
        [Description("流程权限")]
        ProtocolManager = 9,
    }
}